# 执行该脚本修改数据库字段名 isBigPic -> picType

cd /opt/Tim/db/
sqlite3 pic.db> /dev/null 2>&1 << eeooff
ALTER TABLE PicDb RENAME TO PicDbOld;
CREATE TABLE IF NOT EXISTS  PicDb(picName TEXT    PRIMARY KEY     NOT NULL,license TEXT    NOT NULL,devNo BLOB    NOT NULL,shotTimeBcd BLOB    NOT NULL,shotTime DATE    NOT NULL,parkNo BLOB,camId INT     NOT NULL,fileNo INT     NOT NULL,gga TEXT    NOT NULL,rmc TEXT    NOT NULL,carLocationNo TEXT,isUploaded BOOLEAN NOT NULL        DEFAULT 0,picType NUMERIC NOT NULL        DEFAULT 0,isDelete BOOLEAN NOT NULL        DEFAULT 0,retryCounts INT     NOT NULL        DEFAULT 0);
INSERT INTO PicDb SELECT picName,license,devNo,shotTimeBcd,shotTime,parkNo,camId,fileNo,gga,rmc,carLocationNo,isUploaded,isBigPic as picType,isDelete,retryCounts FROM PicDbOld;
DROP TABLE PicDbOld;
.quit
eeooff
echo done!
